import request from "@/utils/request"

export default{
    //分页查询或条件查询
    search(page,rows,searchMap){
        return request({
            method:"post",
            url:`/goods/search/${page}/${rows}`,
            data:{
                searchMap,
            }
        })
    },
    //添加商品
    add(goods){
        return request({
            method:"post",
            url:"/goods/add",
            data:{
                goods,
            }
        })
    },
    getOne(id){
        return request({
            method:"get",
            url:`/goods/getOne/${id}`,
        })
    },
    update(goods){
        return request({
            method:"put",
            url:`/goods/editOne`,
            data:{
                data:goods,
            }
        })
    },
    deleteOne(id){
        return request({
            method:"delete",
            url:`/goods/deleteOne/${id}`,
        })
    }
}